package tsing.javase.designpattern.stratege.vipstrategy.context;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.tsing.javase.designpattern.stratege.vipstrategy.strategy.GiveVipStrategy;

import java.util.Map;

/**
 * @Date 2023/10/24 16:08
 */
@Component
public class GiveVipStrategyContext {


    @Autowired
    private GiveVipStrategyMap giveVipStrategyMap ;


    public  GiveVipStrategy creteGiveVipStrategyMethod(int type){
        return giveVipStrategyMap.getStrategyMap().get(type);

    }

    public void doHandleGiveVip(int type){
        GiveVipStrategy giveVipStrategy = giveVipStrategyMap.getStrategyMap().get(type);
        giveVipStrategy.giveVipMethod();
    }

}
